package com.github.boluo1230.wechat.entity.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class WxResponse {
    @JsonProperty("errcode")
    private Integer errCode;

    @JsonProperty("errmsg")
    private String errMsg;

    public boolean isSuccess() {
        return errCode == null || errCode.equals(0);
    }

    public WxResponse(Integer errCode) {
        this.errCode = errCode;
    }

    public static final WxResponse FAIL = new WxResponse(-1);
}
